﻿using System;
using System.Data;
using System.Configuration;

public partial class Message : System.Web.UI.Page
{
    private static readonly string WEB_PATH = ConfigurationManager.AppSettings["WebPath"];

    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["Message"] == null)
        {
            this.hypMessage.Text = "未知的错误，请与管理员联系！";
            this.hypMessage.NavigateUrl = "~/Manage/MainFrom.aspx";
        }
        else
        {
            if (Session["EDITPASSOK"] != null) {
                CompetenceLib cl = new CompetenceLib();
                cl.OutLogin();
            }
            if (Session["Onclick"] != null)
            {
                this.hypMessage.NavigateUrl = Session["Onclick"].ToString();//"Onclick"
            }
            this.hypMessage.Text = Session["Message"].ToString();
            if (Session["Url"] != null)
            {
                this.hypMessage.NavigateUrl = WEB_PATH + Session["Url"].ToString();
            }
        }

        if (Session["OtherMessage"] != null)
        {
            this.divRe.Attributes.Add("display", "");
            this.hypRe.Text = Session["OtherMessage"].ToString();
            if (Session["OtherUrl"] != null)
            {
                this.hypRe.NavigateUrl = Session["OtherUrl"].ToString();
            }    
        }
        else
        {
            this.divRe.Attributes.Add("display", "none");
        }

        Session.Remove("Onclick");
        Session.Remove("Message");
        Session.Remove("Url");
    }
}
